namespace YXShop.ExcelLite
{
    using System;

    internal class IntFormulaToken : FormulaToken
    {
        private ushort value;

        public IntFormulaToken() : base(FormulaTokenCode.Int, 3, FormulaTokenType.Operand)
        {
        }

        public override byte[] ConvertToBytes()
        {
            byte[] array = base.ConvertToBytes();
            BitConverter.GetBytes(this.Value).CopyTo(array, 1);
            return array;
        }

        public override void DelayInitialize(object[] data)
        {
            this.value = (ushort) data[0];
        }

        public override void Read(byte[] rpnBytes, int startIndex)
        {
            this.value = BitConverter.ToUInt16(rpnBytes, startIndex);
        }

        public override string ToString()
        {
            return this.value.ToString();
        }

        public ushort Value
        {
            get
            {
                return this.value;
            }
        }
    }
}

